// ScripRef.cpp : implementation file
//

#include "stdafx.h"
#include "SwordBible.h"
#include "ScripRef.h"


// CScripRef dialog

IMPLEMENT_DYNAMIC(CScripRef, CDialog)

CScripRef::CScripRef(CWnd* pParent /*=NULL*/)
	: CDialog(CScripRef::IDD, pParent)
{

}

CScripRef::~CScripRef()
{
}

void CScripRef::DoDataExchange(CDataExchange* pDX)
{
	CDialog::DoDataExchange(pDX);
	DDX_Control(pDX, IDC_RICHEDIT_SCRIPREF, richCtrl);
}


BEGIN_MESSAGE_MAP(CScripRef, CDialog)
	ON_WM_SIZE()
END_MESSAGE_MAP()


// CScripRef message handlers

void CScripRef::OnSize(UINT nType, int cx, int cy)
{
	CDialog::OnSize(nType, cx, cy);

	CWnd* pWnd = GetDlgItem(IDC_RICHEDIT_SCRIPREF);

	// resize the rich edit  control
	if( ::IsWindow(pWnd ->GetSafeHwnd() )) 
	pWnd ->SetWindowPos(NULL,10,40,cx-20,cy-50,SWP_NOZORDER | SWP_NOACTIVATE);



	// TODO: Add your message handler code here
}

void CScripRef::SetText(CString text)
{
	richCtrl.SetRTF(text);
}

BOOL CScripRef::OnInitDialog()
{
	CDialog::OnInitDialog();

	richCtrl.SetEventMask(ENM_MOUSEEVENTS | ENM_KEYEVENTS | ENM_SCROLLEVENTS);
	richCtrl.SendMessage(EM_EXLIMITTEXT,0,-1);



	return TRUE;  // return TRUE unless you set the focus to a control
	// EXCEPTION: OCX Property Pages should return FALSE
}
